package com.firstclass.controller;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.firstclass.entity.TakestudentEntity;
import com.firstclass.entity.TaketeacherEntity;
import com.firstclass.service.TaketeacherService;
import com.firstclass.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 *
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2021-12-24 09:35:36
 */
@RestController
@RequestMapping("back/taketeacher")
public class TaketeacherController {
    @Autowired
    private TaketeacherService taketeacherService;

    /**
     * 查
     */
    @GetMapping("find_taketeacher")
    public String findTakeCourse(String name, String num, String subject) {
        return R.ok(taketeacherService.queryByCondition(name, num, subject));
    }


    /**
     * 增，改
     */
    @PostMapping("save_taketeacher")
    public String saveCourse(@RequestBody TaketeacherEntity taketeacherEntity) {
        taketeacherService.save(taketeacherEntity);
        return R.ok();
    }

    /**
     * 删
     */
    @PostMapping("del_taketeacher")
    public String batchDel(@RequestBody List<Integer> ids) {
        taketeacherService.removeByIds(ids);
        return R.ok();
    }
}
